package com.redwood.report.adapter.bak;

import android.widget.CheckBox;
import android.widget.CompoundButton;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.redwood.report.R;
import com.redwood.report.common.Constant;
import com.redwood.report.entity.bak.been.BaoXiuSearchBeen;
import com.redwood.report.util.Utils;

/**
 * 回收箱
 * Created by Supeng on 2018/8/23.
 */
//Caption been
public class HuiShouXiangAdapter extends BaseQuickAdapter<BaoXiuSearchBeen, BaseViewHolder> {
    public HuiShouXiangAdapter() {
        //item layout
        super(R.layout.layout_huixiang_item);
    }
    //设置控件数据
    @Override
    protected void convert(final BaseViewHolder helper, final BaoXiuSearchBeen item) {
        helper.setText(R.id.tv_bianhao,item.getWxid());
        ((CheckBox)helper.getView(R.id.cb_selected)).setChecked(item.isSeleted());
        ((CheckBox)helper.getView(R.id.cb_selected)).setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                item.setSeleted(isChecked);
            }
        });
        helper.setText(R.id.tv_name,"【"+item.getMacID()+item.getMacName()+"】");
        helper.setText(R.id.tv_baoxiuren,item.getAppName());
        helper.setText(R.id.tv_baoxiutimer, Utils.timerParse(item.getAppTime()));
        if(item.getStatus().equals(Constant.CHEXIAO)) {
            helper.setText(R.id.tv_chexiaotips, "撤销人:");
            helper.setText(R.id.tv_chexiaoyytips,"撤销原因:");
        }else{
            helper.setText(R.id.tv_chexiaotips, "删除人:");
            helper.setText(R.id.tv_chexiaoyytips,"删除原因:");
        }
        helper.setText(R.id.tv_baoxiutimer, Utils.timerParse(item.getAppTime()));
        helper.setText(R.id.tv_chexiaoren, item.getRecName());
        helper.setText(R.id.tv_chexiaotimer, Utils.timerParse(item.getRecTime()));
        helper.setText(R.id.tv_chexiaonr,item.getMtncContent());
    }
}
